from threading import Thread,Event
s=None
e=Event()
def func1():
    print("我来拜山头了")
    global s
    s = "天王盖地虎"
    e.set()

th1=Thread(target=func1)

th1.start()
e.wait(timeout=3)

print("请说口令")
if s=="天王盖地虎":
    print("请进")
else:
    print("打死他")
th1.join()
